// src/kyc/dto/generate-kyc-token.dto.ts
import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty } from 'class-validator';

export class GenerateKycTokenDto {
    @ApiProperty({
        description: 'User ID for KYC token generation',
        example: 'user_123'
    })
    @IsString()
    @IsNotEmpty()
    userId: string;
}

export class KycTokenResponseDto {
    @ApiProperty({
        description: 'Generated KYC access token',
        example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
    })
    token: string;
}

export class KycStatusDto {
    @ApiProperty({
        description: 'KYC verification status',
        example: 'approved',
        enum: ['init', 'pending', 'prechecked', 'queued', 'completed', 'onHold', 'rejected']
    })
    status: string;

    @ApiProperty({
        description: 'KYC verification level',
        example: 'id-and-liveness'
    })
    level: string;

    @ApiProperty({
        description: 'Review result',
        example: 'GREEN',
        enum: ['GREEN', 'RED', 'YELLOW']
    })
    reviewResult?: string;

    @ApiProperty({
        description: 'Review answer',
        example: 'FINAL'
    })
    reviewAnswer?: string;

    @ApiProperty({
        description: 'Reject labels',
        example: ['BLACKLIST']
    })
    rejectLabels?: string[];

    @ApiProperty({
        description: 'Review date',
        example: '2024-01-01T00:00:00.000Z'
    })
    reviewDate?: string;
}

export class KycCheckDto {
    @ApiProperty({
        description: 'Check type',
        example: 'idDocument'
    })
    type: string;

    @ApiProperty({
        description: 'Check result',
        example: 'GREEN',
        enum: ['GREEN', 'RED', 'YELLOW']
    })
    result: string;

    @ApiProperty({
        description: 'Check answer',
        example: 'FINAL'
    })
    answer: string;

    @ApiProperty({
        description: 'Check date',
        example: '2024-01-01T00:00:00.000Z'
    })
    date: string;
}

export class KycInfoDto {
    @ApiProperty({
        description: 'Applicant ID',
        example: 'user_123'
    })
    id: string;

    @ApiProperty({
        description: 'External user ID',
        example: '0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6_1'
    })
    externalUserId: string;

    @ApiProperty({
        description: 'KYC level',
        example: 'id-and-liveness'
    })
    level: string;

    @ApiProperty({
        description: 'KYC status',
        example: 'completed'
    })
    status: string;

    @ApiProperty({
        description: 'Review result',
        example: 'GREEN'
    })
    reviewResult?: string;

    @ApiProperty({
        description: 'Created date',
        example: '2024-01-01T00:00:00.000Z'
    })
    createdAt: string;

    @ApiProperty({
        description: 'Updated date',
        example: '2024-01-01T00:00:00.000Z'
    })
    updatedAt: string;
}